//图片按比例缩放
function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){
        ImgD.style.width=iwidth+"px";
        ImgD.style.height=(image.height*iwidth)/image.width;
        }else{
	        ImgD.style.width=image.width+"px";  
	        ImgD.style.height=image.height+"px";
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    else{
        if(image.height>iheight){  
        ImgD.style.height=iheight+"px";
        ImgD.style.width=(image.width*iheight)/image.height+"px";        
        }else{
        ImgD.style.width=image.width+"px";  
        ImgD.style.height=image.height+"px";
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    }
} 

function resizeWindow(settings){
	var $resizDocument = settings.resizDocument;	//随分辨率改变而改变的jquery对象，此对象宽度一般为min-width为确切值，width为100%
	var resizeWidth = settings.resizeWidth;			//随分辨率改变而改变的jquery对象最小宽度
	var widthDiff = $resizDocument.width()-resizeWidth;
	if(widthDiff<0){
		widthDiff = 0;
	}
	var $document ;
	var documentWidth ;
	jQuery(settings.documents).each(function(i){
		$document = this.document;	
		documentWidth = this.documentWidth;	
		$document.width(documentWidth+widthDiff);
	});
}

function loadItemFullView(url){
	jQuery("#ItemFullView").load(url);
}